perm filename GFLET.TEX[CLS,LSP] blob
sn#845860 filedate 1987-09-15 generic text, type T, neo UTF8
\input macros
\drafttrue
\def\bookline{\CLOS\ Specification}
\def\chapline{Functions in the Programmer Interface}
\begincom{generic-flet}\ftype{Special Form}
\label Purpose:
The {\bf generic-flet} special form is an analog to the Common Lisp {\bf
flet}. It produces new generic functions and establishes new local
function definition bindings. Each generic function is created with the set
of methods specified by its method definitions.
The special form {\bf generic-flet} is used to define functions whose
names are meaningful only locally and to execute a series of forms
with these function definition bindings. Any number of such local
generic functions may be defined.
The names of functions defined by {\bf generic-flet} have lexical
scope; they retain their local definitions only within the body of the
{\bf generic-flet}. Any references within the body of the {\bf
generic-flet} to functions whose names are the same as those defined
within the {\bf generic-flet} are thus references to the local
functions instead of to any global functions of the same names. The
scope of these function definition bindings, however, includes only
the body of {\bf generic-flet}, not the definitions themselves.
Within the function definitions, local function names that match those
being defined refer to global functions defined outside the {\bf
generic-flet}. It is thus not possible to define recursive functions
with {\bf generic-flet}.
The {\it form\/} arguments are executed in order.
\label Syntax:
\Defspec _{generic-flet} {
\lparen{\rm$\{$}
\lparen \it name
\vtop{
\hbox{\star{\curly{method-qualifiers}} specialized-lambda-list}
\hbox{\star{\curly{declaration $\vert$ documentation}}
\star{\curly{form}} \rparen \star{\rm$\}$}\rparen\enskip\star\form}}}
\label Arguments:
The {\it method-qualifiers\/} and {\it specialized-lambda-list\/} arguments
are the same as for {\bf defmethod}.
\label Values:
The result returned by {\bf generic-flet} is the value or values
returned by the last form executed. If no forms are specified,
{\bf generic-flet} returns {\bf nil}.
\label Remarks:
A {\bf generic-flet} local method definition is identical in form to the
method definition part of a {\bf defmethod}.
The fact that a generic function is already bound to a variable of the
same name or to a symbol is irrelevant to the operation of this
form.
\label See Also:
{\bf generic-labels
defmethod
defgeneric-options
generic}
\endcom
\end